package com.linq.cool.entities;

import com.linq.cool.tree.annotation.TreeChild;
import com.linq.cool.tree.annotation.TreeEntity;
import com.linq.cool.tree.annotation.TreeId;
import com.linq.cool.tree.annotation.TreePid;
import javafx.scene.control.MenuItem;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: yqlin
 * @Date: 2020/11/24 13:27
 * @Description:
 * @Version: 1.0.0
 */
@TreeEntity
@Data
@Accessors(chain = true)
@AllArgsConstructor
public class Menu {
    @TreeId
    private String id;

    private String name;

    @TreePid
    private String pid;

    @TreeChild
    private List<Menu> child = new ArrayList<>();

    public Menu(String id, String name, String pid) {
        this.id = id;
        this.name = name;
        this.pid = pid;
    }
}
